<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div class="data">
        测试表单：<input type="text" v-model="txt" @input="inp">
    </div>

    <script src="./vue.js"></script>
    <script>
        let vue = new Vue({
            el: '.data',
            data: {
                txt: '',
                timer: ''
            },
            methods: {
                inp() {
                    if (this.timer !== undefined) {
                        clearTimeout(this.timer)
                    }
                    this.timer = setTimeout(() => {
                        console.log(this.txt)
                    }, 1000)
                }
            }
        })
    </script>
</body>

</html>